<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http：//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>易商通运营平台</title>
    <script type="text/javascript" src="__PUBLIC__/libs/js/jquery.js"></script>
    <script type="text/javascript" src="__PUBLIC__/libs/js/framework.js"></script>
    <link href="__PUBLIC__/libs/css/import_basic.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" type="text/css" id="skin" prePath="__PUBLIC__/"/>
    <link rel="stylesheet" type="text/css" id="customSkin"/>
    <script type="text/javascript" src="__PUBLIC__/libs/js/form/datePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="__PUBLIC__/libs/js/nav/pageNumber.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/showdate.js"></script>
    <style>body {
        background-color: #dbeefd
    }</style>

    <script type="text/javascript">
        $(document).ready(function(){
            $("#ordernumber").click(function() {
                top.Dialog.open({URL:"__APP__/finance/searchorder",Title:"选择订单",Width:850,Height:500});
            });
        })

        function ajaxtext(){
            var amount=document.getElementById("amount").value;
            amount= parseInt(amount);
        }


    </script>
</head>
<body>

<div class="box1">
    <fieldset style="border-color:#999999;">
        <legend>财务收入编辑</legend>
        <form action="__URL__/saveincome" method="post">
            <table class="tableStyle">
                <tr >
                    <td align="right"> 订单号：</td>
                    <td>
                        <input type="text" name="ordernumber" id="ordernumber" readonly="readonly" value="{$finance.ordernumber}" style="width:200px;" />
                        <input type="hidden" name="agreementid" id="agreementid" value="{$finance.agreementid}"  />
                        <input type="hidden" name="cid" id="cid" value="{$finance.cid}"  />
                        <input type="hidden" name="cname" id="cname" value="{$finance.cname}" />
                        <input type="hidden" name="feename" id="feename" value="{$finance.feename}"  />
                    </td>
                </tr>
                <tr id="customname_tr" style="<if condition="$action eq 'edit'">display:""; <else />  display: none;</if>">
                    <td align="right"> 客户：</td>
                    <td  id="customname_td">{$agreementdata.customname}
                    </td>
                </tr>
                <tr id="cname_tr" style="<if condition="$action eq 'edit'">display:""; <else />  display: none;</if>">
                    <td  align="right"> 业务员：</td>
                    <td  id="cname_td">{$finance.cname}
                    </td>
                </tr>
                <tr  id="feename_tr" style="<if condition="$action eq 'edit'">display:""; <else />  display: none;</if>">
                    <td  align="right"> 费用类型：</td>
                    <td id="feename_td">{$finance.feename}
                    </td>
                </tr>

                <tr>
                    <td  align="right"> 日期：</td>
                    <td>
                        <input type="text" name="thedate" id="thedate"
                               value="<?php if($finance!=null&& $finance['thedate']!='0000-00-00 00:00:00')
                               echo date('Y-m-d',strtotime($finance['thedate']));?>"
                               style="width:120px;" onclick="return Calendar('thedate');" />
                    </td>
                </tr>
                <tr>
                    <td  align="right"> 金额：</td>
                    <td>
                        <input type="text" name="amount" id="amount"  onpropertychange="ajaxtext()" oninput="ajaxtext()"
                               onKeyDown="this.value=this.value.replace(/[^\d\.]/g,'')"
                               onKeyUp="this.value=this.value.replace(/[^\d\.]/g,'')"
                               onafterpaste="this.value=this.value.replace(/[^\d\.]/g,'')"
                               value="{$finance.amount}"
                               style="width:200px;" />
                    </td>
                </tr>


                <tr>
                    <td  align="right">备注：</td>
                    <td>  <textarea name="remark" rows="2" cols="20" id="remark" class="formTextarea"
                                    style="height:50px;width:400px;">{$finance.remark}</textarea>
                    </td>
                </tr>
                <tr>
                    <td  align="right">发票号：</td>
                    <td><input type="text" name="invoice" id="invoice" value="{$finance.invoice}" style="width:200px;" /></td>
                </tr>
                <tr>
                    <td colspan="2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &nbsp; &nbsp; &nbsp;
                        <input type="submit" name="" value="保存"/>
                        <input name="action" type="hidden"   value="{$action}" />
                        <input name="id" type="hidden"   value="{$finance.id}" />
                    </td>
                </tr>

            </table>
        </form>
    </fieldset>
</div>
</body>
</html>